import 'package:flutter_shop/pages/cart/cart_tab_page/entity/cart_goods_data.dart';

cartGoodsDataFromJson(CartGoodsData data, Map<String, dynamic> json) {
	if (json['goodsId'] != null) {
		data.goodsId = json['goodsId']?.toString();
	}
	if (json['goodsName'] != null) {
		data.goodsName = json['goodsName']?.toString();
	}
	if (json['image'] != null) {
		data.image = json['image']?.toString();
	}
	if (json['count'] != null) {
		data.count = json['count']?.toInt();
	}
	if (json['price'] != null) {
		data.price = json['price']?.toDouble();
	}
	if (json['oriPrice'] != null) {
		data.oriPrice = json['oriPrice']?.toDouble();
	}
	if (json['checked'] != null) {
		data.checked = json['checked'];
	}
	return data;
}

Map<String, dynamic> cartGoodsDataToJson(CartGoodsData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['goodsId'] = entity.goodsId;
	data['goodsName'] = entity.goodsName;
	data['image'] = entity.image;
	data['count'] = entity.count;
	data['price'] = entity.price;
	data['oriPrice'] = entity.oriPrice;
	data['checked'] = entity.checked;
	return data;
}